﻿@model PagedList.IPagedList<VehicleOOBWeb.Models.Personallnfo>

@{
    ViewBag.Title = "Quản lý tài khoản";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section featured {
    <div class="header2">
        <img class="right" src="/images/heder_bg.gif" alt="" />
        <h2 class="header2">Quản lý tài khoản hệ thống</h2>
    </div>
}
<p>
    @Html.ActionLink("Tạo mới tài khoản", "CreateAccount")
</p>
<table class="tbInherit">
    <tr>
        <th>
            @Html.DisplayName("Họ")            
        </th>
        <th>
            @Html.DisplayName("Tên")
        </th>
        <th>
            @Html.DisplayName("Địa chỉ")
        </th>
        <th>
            @Html.DisplayName("Ngày sinh")
        </th>
        <th>
            @Html.DisplayName("SĐT")
        </th>
        <th>
            @Html.DisplayName("CMND")
        </th>
        <th class="action"></th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @item.last_name
            </td>
            <td>
                @item.first_name
            </td>
            <td>
                @item.address
            </td>
            <td>
                @item.dob.Value.ToString("dd/MM/yyyy")
            </td>
            <td>
                @item.phone
            </td>
            <td>
                @item.id_number
            </td>
            <td>
                <a href="/Account/EditAccount/@item.username">
                    <img src='/Images/icon-edit.gif' alt='edit' />
                </a>

                <a href="/Account/DeleteAccount/@item.username">
                    <img src='/Images/icon-del.png' alt='del' />
                </a>
            </td>
        </tr>
    }

</table>


@if (Model.PageCount > 1)
{
    @:<div class="pager">
    @:Trang 
        if (Model.HasPreviousPage)
        {
            @Html.ActionLink("<<", "ManageAccount", new { page = 1 })
            @Html.Raw(" ");
            @Html.ActionLink("<", "ManageAccount", new { page = Model.PageNumber - 1 })
            @Html.Raw(" ");
        }
        else
        {
            @:<<
            @Html.Raw(" ");
            @:<   
        }
        @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) @Html.Raw("/") @Model.PageCount

        if (Model.HasNextPage)
        {
            @Html.Raw(" "); 
            @Html.ActionLink(">", "ManageAccount", new { page = Model.PageNumber + 1 })
            @Html.Raw(" "); 
            @Html.ActionLink(">>", "ManageAccount", new { page = Model.PageCount })
        }
        else
        {
            @:>
            @Html.Raw(" ")
            @:>>   
        }
    @:</div>
}

